<ion-view class="bg">
  <ion-header-bar class="bar bar-positive">
    <button class="button back-button buttons icon ion-ios-arrow-left button-clear" nav-direction="back" ui-sref="tab.workbench">返回</button>
    <h3 class="title">我的订单</h3>
    <button class="button button-icon icon ion-ios-search" ng-click="modal.show()"></button>
  </ion-header-bar>
  <ion-content>
    <ion-refresher pulling-text="下拉刷新..." on-refresh="doRefresh()"></ion-refresher>
    <div ng-if="showloading" class="ion-spinner">
      <ion-spinner icon="lines" class="spinner-calm"></ion-spinner>
    </div>
    <ion-list class="myList" ng-if="showloading == false">
      <h5 ng-if="orderData==''" class="notFound">未找到数据</h5>
      <li class="item li" ng-click="goDetail(data.ID)" ng-repeat="data in orderData">
        <div>
          <i class="contentColor">订单编号</i>
          <i class="value">{{data.ORDER_NO}}</i>
        </div>
        <img src="img/orderState-{{data.ORDER_STATUS}}.png" class="stateImg">
        <div>
          <i class="contentColor">货物名称</i>
          <i class="value">{{data.GOODS_NAME}}</i>
          <i class="value">{{data.PIECES}}件</i>
        </div>
        <div>
          <i class="contentColor">收货电话</i>
          <a class="value" ng-click="callPhone(data.CONSIGNEE_PHONE);$event.stopPropagation();" style="text-decoration: underline;color: #387ef5;">{{data.CONSIGNEE_PHONE}}</a>
          <i style="float: right;font-size: 13px;color: #999;">{{data.ORDER_DATE | date : "yyyy-MM-dd"}}</i>
        </div>
        <div class="btnDiv" ng-if="data.ORDER_STATUS=='0'||data.ORDER_STATUS=='2'">
          <div class="button button-positive longButton" ng-click="orderRevoke(data.ID);$event.stopPropagation();">撤销</div>
        </div>
        <div class="btnDiv" ng-if="data.ORDER_STATUS=='4'">
          <div class="button button-light leftButton" ng-click="changeOrder(data.ID);$event.stopPropagation();">修改</div>
          <div class="button button-positive rightButton" ng-click="orderSubmit(data.ID);$event.stopPropagation();">提交</div>
        </div>
      </li>
    </ion-list>
    <ion-infinite-scroll on-infinite="loadMore()" distance="1%" ng-if="hasNextPage()"></ion-infinite-scroll>
  </ion-content>
</ion-view>
